<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Uploader
 *
 * @author Zelic
 */
class Lib_Helper_Uploader {
    static function upload($field){
        $actualPath = $_SERVER['DOCUMENT_ROOT'].Lib_Registry::$data['root'].'/res/upload/'.  basename($_FILES[$field]['name']);
        $accessPath = 'http://'.Lib_Registry::$data['host'].Lib_Registry::$data['root'].'/res/upload/'.  basename($_FILES[$field]['name']);
        if (move_uploaded_file($_FILES[$field]['tmp_name'], $actualPath)){
            return $accessPath;
        }
        return false;
    }
}

?>
